function obj = demand_objective_outer(x_select, ind_select, x, ...
    K, D, N,...
    pr_fc, x_fc, lapse, beta_c, crra, rho, sigma_c1, sigma_c2, eulerc,...
    N_y, pr_y, y_medi, T1, T2, B1_c, B2_c, naic_unique,...
    no_insurer_fe, delta, use_log_n, myopic,...
    resource_y1, resource_y2)

x(ind_select) = x_select;

obj = demand_objective_inner(x, K, D, N,...
    pr_fc, x_fc, lapse, beta_c, crra, rho, sigma_c1, sigma_c2, eulerc,...
    N_y, pr_y, y_medi, T1, T2, B1_c, B2_c, naic_unique,...
    no_insurer_fe, ind_select, delta, use_log_n, myopic,...
    resource_y1, resource_y2);
